<div class="wrapper-md" ng-controller="purchasingOrder">
    <toaster-container toaster-options="{'position-class': 'toast-top-center', 'close-button':true}"></toaster-container>
    <div ng-if="warehouseList" class="panel panel-default">
        <div class="panel-heading">
            {{title.title}}
            <!--<button style="float: right;margin-top: -5px;margin-left: 15px;" class="btn m-b-xs btn-sm btn-info btn-addon">-->
            <!--<i class="fa fa-trash-o"></i>删除-->
            <!--</button>-->
            <button ng-click="warehouseJump()"  style="float: right;margin-top: -5px;margin-left:5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-plus"></i>新建
            </button>
            <button style="float: right;margin-left: 5px;margin-top: -5px;" class="btn m-b-xs btn-sm btn-success btn-addon">
                <i class="fa fa-file-excel-o"></i><a ng-click="excel()" download="导出Excel" id="excelOut" href="#">导出</a>
            </button>
            <button ng-click="searchTableShow = !searchTableShow"  style="float: right;margin-top: -5px;margin-left:5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-arrows-v"></i>精确搜索
            </button>
            <button ng-click="actions.closeAll()"  style="float: right;margin-top: -5px;margin-left:5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-minus-square-o"></i>批量收起
            </button>
            <button ng-click="actions.openAll()"  style="float: right;margin-top: -5px;margin-left:5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-plus-square-o"></i>批量展开
            </button>
        </div>
        <div ng-if="searchTableShow" class="panel-body b-b b-light">
            <!--搜索: <input id="filter" type="text" class="form-control input-sm w-sm inline m-r"/>-->
            <table class="table m-b-none" id="searchTable">
                <tbody>
                <tr>
                    <td class="myLabel">供应商</td>
                    <td>
                        <input id="searchGys" placeholder="点击选择" ng-click="showSelectCustomer('searchGys')" readonly type="text" class="form-control input-sm w-sm inline m-r"/>
                        <a onclick="document.getElementById('searchGys').value = ''" title="清空"><i class="fa fa-close"></i></a>
                    </td>
                    <td class="myLabel">货品名称</td>
                    <td>
                        <input placeholder="点击选择" id="searchHpmc" ng-click="showSelectGoods(null,null,'searchHpmc')" readonly type="text" class="form-control input-sm w-sm inline m-r"/>
                        <input id="searchHpmcId" style="display:none" type="text"/>
                        <a onclick="document.getElementById('searchHpmc').value = '';document.getElementById('searchHpmcId').value = ''" title="清空"><i class="fa fa-close"></i></a>
                    </td>
                    <td class="myLabel">制单日期</td>
                    <td>
                        <div style="display: inline" ng-controller="DatepickerDemoCtrl">
                        <input id="searchStart" style="width:80px;float: left" ng-click="open($event)" readonly type="text" class="form-control input-sm w-sm inline m-r"
                               datepicker-popup="{{format}}" ng-model="searchStart" is-open="opened"
                               datepicker-options="dateOptions" ng-required="true"
                               close-text="关闭"/>
                        </div>
                        <span style="vertical-align: -webkit-baseline-middle;">至</span>
                        <div style="display: inline" ng-controller="DatepickerDemoCtrl">
                        <input id="searchEnd" style="width:80px;float: right" readonly style="margin-left: 15px;" type="text" class="form-control input-sm w-sm inline m-r"
                               datepicker-popup="{{format}}" ng-model="dt" is-open="opened"
                               datepicker-options="dateOptions" ng-required="true"
                               close-text="关闭" ng-click="open($event)"/>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="myLabel">订单总金额</td>
                    <td>
                        <input id="searchJeStart" style="width:30%" type="text" class="form-control input-sm w-sm inline m-r"/>
                        至<input id="searchJeEnd" style="margin-left: 15px;width:30%" type="text" class="form-control input-sm w-sm inline m-r"/>
                    </td>
                    <td class="myLabel">订单编码</td>
                    <td><input id="searchBm" type="text" class="form-control input-sm w-sm inline m-r"/></td>
                    <td class="myLabel">制单人</td>
                    <td>
                        <input id="searchZdr" placeholder="点击选择" ng-click="showSelectUser('searchZdr','searchZdrId')" readonly type="text" class="form-control input-sm w-sm inline m-r"/>
                        <input id="searchZdrId" style="display:none" type="text"/>
                        <a onclick="document.getElementById('searchZdr').value = '';document.getElementById('searchZdrId').value = ''" title="清空"><i class="fa fa-close"></i></a>
                    </td>
                </tr>
                <tr>
                    <td class="myLabel">收货仓库</td>
                    <td>
                        <select  id="searchShck" class="form-control input-sm w-sm inline m-r" ng-model="shckmylabel" ng-options="v for v in shcklists"></select>
                    </td>
                    <td class="myLabel">结算方式</td>
                    <td><select  id="searchJsfs" class="form-control input-sm w-sm inline m-r" ng-model="mylabel" ng-options="v for v in lists"></select></td>
                    <td class="myLabel">文件状态</td>
                    <td colspan="5">
                        <select  id="searchState" class="form-control input-sm w-sm inline m-r" ng-model="searchState" ng-options="v for v in searchStatelists"></select>
                    </td>
                </tr>
                <tr>
                    <td class="myLabel" colspan="4"></td>
                    <td colspan="2">
                        <button ng-click="actions.searchTrue()" style="float: left;" class="btn m-b-xs btn-sm btn-default btn-addon">
                            <i class="fa fa-search"></i>明细查询
                        </button>
                        <button ng-click="actions.searchFalse()" style="float: left;" class="btn m-b-xs btn-sm btn-default btn-addon">
                            <i class="fa fa-search"></i>汇总查询
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div>
            <!--ui-jq="footable" data-filter="#filter" data-page-size="30"-->
            <table ng-if="searchType" class="table m-b-none" id="tableToExcel">
                <thead>
                <tr>
                    <th>{{columns[0].title}}</th>
                    <th>{{columns[1].title}}</th>
                    <th>{{columns[2].title}}</th>
                    <th>{{columns[3].title}}</th>
                    <th>{{columns[4].title}}</th>
                    <th>{{columns[5].title}}</th>
                    <th>{{columns[6].title}}</th>
                    <th>{{columns[7].title}}</th>
                    <th>{{columns[8].title}}</th>
                    <th>{{columns[9].title}}</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat-start="tb in saveDate">
                    <td>{{tb.createTime}}</td>
                    <td><a href ng-click="showInfo(tb)"><u>{{tb.purchaseDdbh}}</u></a></td>
                    <td>{{tb.purchaseGys}}</td>
                    <td>{{tb.purchaseShck}}</td>
                    <td><span class="{{tb.status1}}" title="Active">{{tb.state}}</span></td>
                    <td>{{tb.showZje}}</td>
                    <td>---</td>
                    <td>{{tb.zje}}</td>
                    <td>{{tb.zsl}}</td>
                    <td style="cursor: pointer" ng-click="actions.showListDetails(tb)"><i class="fa fa-plus"></i></td>
                </tr>
                <tr class="{{tb.purchaseId}}" style="display:none;background-color: #f7f7f7;" ng-repeat-end ng-repeat="de in tb.details">
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{{de.purchasegoodsdetailsHpmc}}</td>
                    <td>{{de.purchasegoodsdetailsHpzje}}</td>
                    <td>{{de.purchasegoodsdetailsHpsl}}</td>
                    <td></td>
                </tr>
                <tr style="background-color:rgb(209, 219, 222);">
                    <td>合计</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{{heji.ddje}}</td>
                    <td></td>
                    <td>{{heji.jehj}}</td>
                    <td>{{heji.sl}}</td>
                    <td></td>
                </tr>
                </tbody>
                <!--<tfoot class="hide-if-no-paging">-->
                <!--<tr>-->
                    <!--<td colspan="5" class="text-center">-->
                        <!--<ul class="pagination"></ul>-->
                    <!--</td>-->
                <!--</tr>-->
                <!--</tfoot>-->
            </table>
            <table ng-if="!searchType" class="table m-b-none" id="tableToExcel">
                <thead>
                <tr>
                    <th>{{columns[0].title}}123</th>
                    <th>{{columns[1].title}}23</th>
                    <th>{{columns[2].title}}</th>
                    <th>{{columns[3].title}}</th>
                    <th>{{columns[4].title}}</th>
                    <th>{{columns[5].title}}</th>
                    <th>{{columns[6].title}}</th>
                    <th>{{columns[7].title}}</th>
                    <th>{{columns[8].title}}</th>
                    <th>{{columns[9].title}}</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat-start="tb in saveDate">
                    <td>{{tb.createTime}}</td>
                    <td><a href ng-click="showInfo(tb)"><u>{{tb.purchaseDdbh}}</u></a></td>
                    <td>{{tb.purchaseGys}}</td>
                    <td>{{tb.purchaseShck}}</td>
                    <td><span class="{{tb.status1}}" title="Active">{{tb.state}}</span></td>
                    <td>{{tb.showZje}}</td>
                    <td>---</td>
                    <td>{{tb.zje}}</td>
                    <td>{{tb.zsl}}</td>
                    <td style="cursor: pointer" ng-click="actions.showListDetails(tb)"><i class="fa fa-plus"></i></td>
                </tr>
                <tr class="{{tb.purchaseId}}" style="display:none;background-color: #f7f7f7;" ng-repeat-end ng-repeat="de in tb.details">
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{{de.purchasegoodsdetailsHpmc}}</td>
                    <td>{{de.purchasegoodsdetailsHpzje}}</td>
                    <td>{{de.purchasegoodsdetailsHpsl}}</td>
                    <td></td>
                </tr>
                <tr style="background-color:rgb(209, 219, 222);">
                    <td>合计</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{{heji.ddje}}</td>
                    <td></td>
                    <td>{{heji.jehj}}</td>
                    <td>{{heji.sl}}</td>
                    <td></td>
                </tr>
                </tbody>
                <!--<tfoot class="hide-if-no-paging">-->
                <!--<tr>-->
                <!--<td colspan="5" class="text-center">-->
                <!--<ul class="pagination"></ul>-->
                <!--</td>-->
                <!--</tr>-->
                <!--</tfoot>-->
            </table>
        </div>
    </div>
    <div ng-if="warehouseAdd && canEdit" class="panel panel-default">
        <div class="panel-heading">
            <u style="cursor:pointer"  ng-if="app.power.powerPurchasingOrder" ng-click="warehouseJump('back')">{{title.title}} / </u>{{title.addTitle}}
            <button ng-click="myPrintShow()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-print"></i>打印
            </button>
            <button ng-if="row.upDateUserId===app.userIdId && row.state!=='提单'" ng-click="saveInfo('sm','th')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-danger btn-addon">
                <i class="fa fa-circle"></i>退回
            </button>
            <button ng-if="row.upDateUserId==='new' || row.upDateUserId===app.userIdId" ng-click="saveInfo('sm','tj')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-info btn-addon">
                <i class="fa fa-play"></i>提交
            </button>
            <button ng-if="row.upDateUserId==='new' || row.upDateUserId===app.userIdId" ng-click="saveInfo('sm','bc')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-plus"></i>保存
            </button>
            <button ng-click="showOrderInfo()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-bars"></i>查看入库详情
            </button>
            <button ng-if="app.power.powerPurchasingOrder" ng-click="warehouseJump('back')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-hand-o-left"></i>返回
            </button>
        </div>
        <div class="panel-body">
            <h3 style="text-align: center"><b>采购订货单</b>&nbsp;&nbsp;&nbsp;&nbsp;<span style="position: absolute" class="{{row.status1}}">{{row.state}}</span></h3>
            <form class="form-horizontal" method="get">
                <h7><b>单据基本信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>制&nbsp;&nbsp;单&nbsp;&nbsp;人</label>
                    <div class="col-sm-3">
                        <input readonly type="text" class="form-control" id="zdr" value="{{row.zdr}}">
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>制单日期</label>
                    <div class="col-sm-3">
                        <input readonly id="createTime" value="{{row.createTime}}" type="text" class="form-control" ng-required="true" />
                    </div>
                    <label readonly class="col-sm-1 control-label" for="input-id-1">订单编码</label>
                    <div class="col-sm-3">
                        <input readonly type="text" class="form-control" id="purchaseDdbh" value="{{row.purchaseDdbh}}">
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-2"><span style="color:red">*</span>供&nbsp;&nbsp;应&nbsp;&nbsp;商</label>
                    <div class="col-sm-3">
                        <input disabled style="width:85%;float: left" type="text" class="form-control" id="purchaseGys" value="{{row.purchaseGys}}">
                        <span class="input-group-btn">
                            <button ng-click="showSelectCustomer('purchaseGys','purchaseLxr','purchaseLxdh')" class="btn btn-default" type="button"><i class="fa fa-plus"></i></button>
                        </span>
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-3">联&nbsp;&nbsp;系&nbsp;&nbsp;人</label>
                    <div class="col-sm-3">
                        <input disabled type="text" class="form-control" id="purchaseLxr" value="{{row.purchaseLxr}}">
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-4">联系电话</label>
                    <div class="col-sm-3">
                        <input disabled type="text" class="form-control" id="purchaseLxdh" value="{{row.purchaseLxdh}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">结算方式</label>
                        <div class="col-sm-3">
                            <select  class="form-control" ng-model="mylabel" ng-options="v for v in lists" id="purchaseJsfs"></select>
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>收货仓库</label>
                    <div class="col-sm-3">
                        <select  class="form-control" ng-model="shckmylabel" ng-options="v for v in shcklists" id="purchaseShck"></select>
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1">预付金额</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="purchaseYfdj" value="{{row.purchaseYfdj}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                    <div class="col-sm-11">
                        <textarea type="text" class="form-control" id="purchaseBz" value="{{row.purchaseBz}}">{{row.purchaseBz}}</textarea>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <h7><b>货品明细信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div style="height: 35px;">
                    <button ng-click="addRows()" style="" class="btn m-b-xs btn-sm btn-success btn-addon">
                        <i class="fa fa-plus"></i>添加
                    </button>
                    <button ng-click="plsc()" style="" class="btn m-b-xs btn-sm btn-danger btn-addon">
                        <i class="fa fa-minus"></i>批量删除
                    </button>
                </div>
            </form>
            <table class="table m-b-none" style="border:1px solid #eaeff0;" border="" cellspacing="0px" cellpadding="0px" width="100%">
                <thead>
                <tr>
                    <th rowspan="2"><input class="checkbox" type="checkbox" ng-click="qx()"/></th>
                    <th style="vertical-align: middle;white-space:nowrap;" colspan="3">货品信息</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">单位</th>
                    <th style="vertical-align: middle;white-space:nowrap;width: 10%;" rowspan="2">数量</th>
                    <th ng-if="app.power.powerPrice" style="vertical-align: middle;white-space:nowrap;" rowspan="2">单价</th>
                    <th ng-if="app.power.powerPrice" style="vertical-align: middle;white-space:nowrap;" rowspan="2">总金额</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">订货日期</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">备注</th>
                    <th style="vertical-align: middle;white-space:nowrap" rowspan="2">操作</th>
                </tr>
                <tr>
                    <th style="vertical-align: middle;white-space:nowrap;">货品编码</th>
                    <th style="vertical-align: middle;white-space:nowrap;">货品名称</th>
                    <th style="vertical-align: middle;white-space:nowrap;">规格型号</th>
                </tr>
                </thead>
                <tbody id="table">
                <tr ng-repeat="g in goods">
                    <td><input type="checkbox" name="ck" ng-click="ck($index)"></td>
                    <td>
                        <a href=""  ng-click="showSelectGoods(g,$index)" class="active" ui-toggle-class="">
                            <i class="fa fa-plus" id="{{g.purchasegoodsdetailsId}}purchasegoodsdetailsHpbm">{{g.purchasegoodsdetailsHpbm}}</i>
                        </a>
                    </td>
                    <td>{{g.purchasegoodsdetailsHpmc}}</td>
                    <td>{{g.purchasegoodsdetailsGgxh}}</td>
                    <td>{{g.purchasegoodsdetailsHpdw}}</td>
                    <td><input ng-model="goods[$index].purchasegoodsdetailsHpsl" ng-change="detailsInput.sl($index)" id="{{g.purchasegoodsdetailsId}}purchasegoodsdetailsHpsl" type="text" class="form-control" value="{{g.purchasegoodsdetailsHpsl}}"></td>
                    <td ng-if="app.power.powerPrice"><a href=""  ng-click="SelectPrice($index,g)" class="active" ui-toggle-class="">
                        <i class="fa fa-plus" id="{{g.purchasegoodsdetailsId}}purchasegoodsdetailsHpdj">{{g.purchasegoodsdetailsHpdj}}</i>
                    </a></td>
                    <td ng-if="app.power.powerPrice">{{g.purchasegoodsdetailsHpzje}}</td>
                    <td><div ng-controller="DatepickerDemoCtrl">
                        <input
                               style="width:64%;float: left" type="text"
                               id="{{g.purchasegoodsdetailsId}}purchasegoodsdetailsDhrq"
                               class="form-control"
                               datepicker-popup="{{format}}" ng-model="dt" is-open="opened"
                               datepicker-options="dateOptions" ng-required="true"
                               close-text="关闭"
                               value="{{g.purchasegoodsdetailsDhrq}}"/>
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                        </span>
                    </div></td>
                    <td><input ng-model="goods[$index].purchasegoodsdetailsBz" ng-change="detailsInput.bz($index)" type="text" class="form-control" id="{{g.purchasegoodsdetailsId}}purchasegoodsdetailsBz" value="{{g.purchasegoodsdetailsBz}}"></td>
                    <td>
                        <a ng-click="dele($index)" class="active" ui-toggle-class="">
                            <i class="fa fa-times text-danger text-active"></i>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label" for="input-id-1">上传附件</label>
                <div class="col-sm-4">
                    <!--onchange='angular.element(this).scope().upFile(this)'-->
                    <input id="uploadFile"  ng-src={{files[0].name}} id="file" ui-jq="filestyle" type="file" data-icon="false" data-classButton="btn btn-default" data-classInput="form-control inline v-middle input-s">
                </div>
                <button type="button" class="btn btn-primary update-button" style="" ng-click="upFile()">
                添加
                </button>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div ng-if="showFiles.length!==0" class="hbox hbox-auto-xs hbox-auto-sm"  >
                <div class="col">
                    <div class="wrapper-md">
                        <table class="table bg-white-only b-a">
                            <thead>
                            <tr>
                                <th width="50%">文件名称</th>
                                <th>大小</th>
                                <th>进度</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in showFiles">
                                <td><strong>{{ item.myFileRealName }}</strong></td>
                                <td nowrap>{{ item.myFileSize/1024/1024|number:2 }} MB</td>
                                <td>
                                    <div class="progress progress-sm m-b-none m-t-xs">
                                        <div class="progress-bar bg-info" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>
                                    <!--<span ng-show="item.isCancel" class="text-warning"><i class="glyphicon glyphicon-ban-circle"></i></span>-->
                                    <span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>
                                </td>
                                <td nowrap>
                                    <button type="button" class="btn btn-default btn-xs" ng-click="doupFile($index)" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
                                        上传
                                    </button>
                                    <button type="button" class="btn btn-default btn-xs" ng-click="" ng-disabled="!item.isCancel">
                                        <a download="" title="下载文件" href = '/a_yongan/upload/{{item.myFileType}}/{{item.myFileDocNumber}}/{{item.myFileName}}'>下载</a>
                                    </button>
                                    <button type="button" class="btn btn-default btn-xs" ng-click="deleteFile($index)">
                                        移除
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </div>
            <h7><b><a ng-click="showFlowDetails()">流转信息&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-sort-amount-asc"></i></a></b></h7>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <table ng-if="showFlowDetailsShow" class="table m-b-none" >
                <thead>
                <tr>
                    <th>序号</th>
                    <th>审批环节</th>
                    <th>审批人</th>
                    <th>审批记录</th>
                    <th>操作时间</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="t in showFlowDetailsData">
                    <td>{{$index+1}}</td>
                    <td>{{t.prFlowName}}</td>
                    <td>{{t.prUser}}</td>
                    <td>{{t.prType}}至{{t.prFlowToName}}（{{t.prToUser}}）</td>
                    <td>{{t.createTime}}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div ng-if="warehouseAdd && (!canEdit)" class="panel panel-default" id="noEdit">
        <div class="panel-heading">
            <u style="cursor:pointer"  ng-if="app.power.powerPurchasingOrder" ng-click="warehouseJump('back')">{{title.title}} / </u>{{title.addTitle}}
            <button ng-click="myPrintShow()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-print"></i>打印
            </button>
            <button ng-if="row.upDateUserId===app.userIdId && row.state!=='提单'" ng-click="saveInfo('sm','th')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-danger btn-addon">
                <i class="fa fa-circle"></i>退回
            </button>
            <button ng-if="row.upDateUserId==='new' || row.upDateUserId===app.userIdId" ng-click="saveInfo('sm','tj')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-info btn-addon">
                <i class="fa fa-play"></i>提交
            </button>
            <button ng-click="showOrderInfo()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-bars"></i>查看入库详情
            </button>
            <button ng-if="app.power.powerPurchasingOrder" ng-click="warehouseJump('back')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-hand-o-left"></i>返回
            </button>
        </div>
        <div class="panel-body">
            <h3 style="text-align: center"><b>采购订货单</b>&nbsp;&nbsp;&nbsp;&nbsp;<span style="position: absolute" class="{{row.status1}}">{{row.state}}</span></h3>
            <form class="form-horizontal" method="get">
                <h7><b>单据基本信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">制&nbsp;&nbsp;单&nbsp;&nbsp;人</label>
                    <div class="col-sm-3">
                        {{row.zdr}}
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1">制单日期</label>
                    <div class="col-sm-3">
                        {{row.createTime}}
                    </div>
                    <label readonly class="col-sm-1 control-label" for="input-id-1">订单编码</label>
                    <div class="col-sm-3">
                        {{row.purchaseDdbh}}
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-2">供&nbsp;&nbsp;应&nbsp;&nbsp;商</label>
                    <div class="col-sm-3">
                        {{row.purchaseGys}}
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-3">联&nbsp;&nbsp;系&nbsp;&nbsp;人</label>
                    <div class="col-sm-3">
                        {{row.purchaseLxr}}
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-4">联系电话</label>
                    <div class="col-sm-3">
                        {{row.purchaseLxdh}}
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">结算方式</label>
                    <div class="col-sm-3">
                        {{mylabel}}
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1">收货仓库</label>
                    <div class="col-sm-3">
                        {{shckmylabel}}
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1">预付金额</label>
                    <div class="col-sm-3">
                        {{row.purchaseYfdj}}
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                    <div class="col-sm-11">
                        {{row.purchaseBz}}
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <h7><b>货品明细信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </form>
            <table class="table m-b-none" style="border:1px solid #eaeff0;" border="" cellspacing="0px" cellpadding="0px" width="100%">
                <thead>
                <tr>

                    <th style="vertical-align: middle;white-space:nowrap;" colspan="3">货品信息</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">单位</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">数量</th>
                    <th ng-if="app.power.powerPrice" style="vertical-align: middle;white-space:nowrap;" rowspan="2">单价</th>
                    <th ng-if="app.power.powerPrice" style="vertical-align: middle;white-space:nowrap;" rowspan="2">总金额</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">订货日期</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">备注</th>
                </tr>
                <tr>
                    <th style="vertical-align: middle;white-space:nowrap;">货品编码</th>
                    <th style="vertical-align: middle;white-space:nowrap;">货品名称</th>
                    <th style="vertical-align: middle;white-space:nowrap;">规格型号</th>
                </tr>
                </thead>
                <tbody id="table">
                <tr ng-repeat="g in goods">
                    <td>{{g.purchasegoodsdetailsHpbm}}</td>
                    <td>{{g.purchasegoodsdetailsHpmc}}</td>
                    <td>{{g.purchasegoodsdetailsGgxh}}</td>
                    <td>{{g.purchasegoodsdetailsHpdw}}</td>
                    <td>{{g.purchasegoodsdetailsHpsl}}</td>
                    <td ng-if="app.power.powerPrice">{{g.purchasegoodsdetailsHpdj}}</td>
                    <td ng-if="app.power.powerPrice">{{g.purchasegoodsdetailsHpzje}}</td>
                    <td>{{g.purchasegoodsdetailsDhrq}}</td>
                    <td>{{g.purchasegoodsdetailsBz}}</td>
                </tr>
                </tbody>
            </table>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div ng-if="showFiles.length!==0" class="hbox hbox-auto-xs hbox-auto-sm"  >
                <div class="col">
                    <div class="wrapper-md">
                        <table class="table bg-white-only b-a">
                            <thead>
                            <tr>
                                <th width="50%">文件名称</th>
                                <th>大小</th>
                                <th>进度</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in showFiles">
                                <td><strong>{{ item.myFileRealName }}</strong></td>
                                <td nowrap>{{ item.myFileSize/1024/1024|number:2 }} MB</td>
                                <td>
                                    <div class="progress progress-sm m-b-none m-t-xs">
                                        <div class="progress-bar bg-info" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>
                                    <!--<span ng-show="item.isCancel" class="text-warning"><i class="glyphicon glyphicon-ban-circle"></i></span>-->
                                    <span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>
                                </td>
                                <td nowrap>
                                    <button type="button" class="btn btn-default btn-xs" ng-click="" ng-disabled="!item.isCancel">
                                        <a download="" title="下载文件" href = '/a_yongan/upload/{{item.myFileType}}/{{item.myFileDocNumber}}/{{item.myFileName}}'>下载</a>
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </div>
            <h7><b><a ng-click="showFlowDetails()">流转信息&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-sort-amount-asc"></i></a></b></h7>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <table ng-if="showFlowDetailsShow" class="table m-b-none" >
                <thead>
                <tr>
                    <th>序号</th>
                    <th>审批环节</th>
                    <th>审批人</th>
                    <th>审批记录</th>
                    <th>操作时间</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="t in showFlowDetailsData">
                    <td>{{$index+1}}</td>
                    <td>{{t.prFlowName}}</td>
                    <td>{{t.prUser}}</td>
                    <td>{{t.prType}}至{{t.prFlowToName}}（{{t.prToUser}}）</td>
                    <td>{{t.createTime}}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div ng-if="isPrint" class="panel panel-default">
        <div class="panel-heading">
            <u>{{title.title}}</u> / {{title.addTitle}}
            <button ng-click="myPrint()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-print"></i>打印
            </button>
            <button ng-click="myPrintShow()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-hand-o-left"></i>返回
            </button>
        </div>
        <div class="panel-body" id="orderPrint">
            <h3 style="text-align: center"><b>采购订货单</b>&nbsp;&nbsp;&nbsp;&nbsp;<span style="position: absolute" class="{{row.status1}}">{{row.state}}</span></h3>
            <form class="form-horizontal" method="get">
                <h7><b>单据基本信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <table class="table m-b-none" style="border:1px solid #eaeff0;" border="" cellspacing="0px" cellpadding="0px" width="100%">
                    <tbody>
                    <tr>
                        <td style="width:20%">制&nbsp;&nbsp;单&nbsp;&nbsp;人</td><td style="width:30%">{{row.zdr}}</td>
                        <td style="width:20%">制单日期</td><td style="width:30%">{{row.createTime}}</td>
                    </tr>
                    <tr>
                        <td>订单编码</td><td>{{row.purchaseDdbh}}</td>
                        <td>供  应  商</td><td>{{row.purchaseGys}}</td>
                    </tr>
                    <tr>
                        <td>联  系  人</td><td>{{row.purchaseLxr}}</td>
                        <td>联系电话</td><td>{{row.purchaseLxdh}}</td>
                    </tr>
                    <tr>
                        <td>结算方式</td><td>{{mylabel}}</td>
                        <td>收货仓库</td><td>{{shckmylabel}}</td>
                    </tr>
                    <tr>
                        <td>预付金额</td><td colspan="3">{{row.purchaseYfdj}}</td>
                    </tr>
                    <tr>
                        <td>备        注</td><td colspan="3">{{row.purchaseBz}}</td>
                    </tr>
                    </tbody>
                </table>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <h7><b>货品明细信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </form>
            <table class="table m-b-none" style="border:1px solid #eaeff0;" border="" cellspacing="0px" cellpadding="0px" width="100%">
                <thead>
                <tr>
                    <th style="vertical-align: middle;white-space:nowrap;" colspan="3">货品信息</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">单位</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">数量</th>
                    <th ng-if="app.power.powerPrice" style="vertical-align: middle;white-space:nowrap;" rowspan="2">单价</th>
                    <th ng-if="app.power.powerPrice" style="vertical-align: middle;white-space:nowrap;" rowspan="2">总金额</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">订货日期</th>
                    <th style="vertical-align: middle;white-space:nowrap;" rowspan="2">备注</th>
                </tr>
                <tr>
                    <th style="vertical-align: middle;white-space:nowrap;">货品编码</th>
                    <th style="vertical-align: middle;white-space:nowrap;">货品名称</th>
                    <th style="vertical-align: middle;white-space:nowrap;">规格型号</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="g in goods">
                    <td>{{g.purchasegoodsdetailsHpbm}}</td>
                    <td>{{g.purchasegoodsdetailsHpmc}}</td>
                    <td>{{g.purchasegoodsdetailsGgxh}}</td>
                    <td>{{g.purchasegoodsdetailsHpdw}}</td>
                    <td>{{g.purchasegoodsdetailsHpsl}}</td>
                    <td ng-if="app.power.powerPrice">{{g.purchasegoodsdetailsHpdj}}</td>
                    <td ng-if="app.power.powerPrice">{{g.purchasegoodsdetailsHpzje}}</td>
                    <td>{{g.purchasegoodsdetailsDhrq}}</td>
                    <td>{{g.purchasegoodsdetailsBz}}</td>
                </tr>
                </tbody>
            </table>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div ng-if="showFiles.length!==0" class="hbox hbox-auto-xs hbox-auto-sm"  >
                <div class="col">
                    <div class="wrapper-md">
                        <table class="table bg-white-only b-a">
                            <thead>
                            <tr>
                                <th width="50%">文件名称</th>
                                <th>大小</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in showFiles">
                                <td><strong>{{ item.myFileRealName }}</strong></td>
                                <td nowrap>{{ item.myFileSize/1024/1024|number:2 }} MB</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </div>
            <h7><b><a>流转信息&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-sort-amount-asc"></i></a></b></h7>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <table ng-if="showFlowDetailsData.length!=0" class="table m-b-none" >
                <thead>
                <tr>
                    <th>序号</th>
                    <th>审批环节</th>
                    <th>审批人</th>
                    <th>审批记录</th>
                    <th>操作时间</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="t in showFlowDetailsData">
                    <td>{{$index+1}}</td>
                    <td>{{t.prFlowName}}</td>
                    <td>{{t.prUser}}</td>
                    <td>{{t.prType}}至{{t.prFlowToName}}（{{t.prToUser}}）</td>
                    <td>{{t.createTime}}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<script type="text/ng-template" id="myModalContent.html">
    <div ng-include="'tpl/modal.html'"></div>
</script>
<script type="text/ng-template" id="selectCustomer.html">
    <div ng-include="'tpl/selectCustomer.html'"></div>
</script>
<script type="text/ng-template" id="selectGoods.html">
    <div ng-include="'tpl/selectGoods.html'"></div>
</script>
<script type="text/ng-template" id="showOrderInfo.html">
    <div ng-include="'tpl/showOrderInfo.html'"></div>
</script>
<script type="text/ng-template" id="selectPrice.html">
    <div ng-include="'tpl/selectPrice.html'"></div>
</script>
<script type="text/ng-template" id="selectUser.html">
    <div ng-include="'tpl/selectUser.html'"></div>
</script>
<style>
    #noEdit .col-sm-3{
        padding-top: 7px;
    }
</style>